<?php if (empty($this->data)) : ?>
    <div class="fail-flash">No record found.</div>
<? else : // ถ้ามีข้อมูล ?>
<?php
        echo $this->element('pageHeader', array(
            'update' => 'divPopUpPaginate',
            'action' => 'popup_site_cost_center_paginate',
        )); ?>
<?php $cur = $paginator->counter(array('format' => '%start%')); ?>
        <table class="data">
            <thead>
                <tr>
                    <th width="40px">No</th>
                    <th><?php echo $paginator->sort("Name", 'SiteCostCenter.name'); ?></th>
                    <th class="action"></th>
                </tr>
            </thead>
            <tbody>
        <?php foreach ($this->data as $i => $data): ?>
            <tr class="<?php echo (($i + 1) % 2 == 0) ? 'even-cell' : 'odd-cell'; ?>">
                <td class="center"><?php echo $i + 1; ?></td>
                <td><?php echo $data['SiteCostCenter']['name']; ?></td>
                <td><?php echo $html->link($html->image('icon/edit.png'), '#', array('onclick' => "popup_click('{$data['SiteCostCenter']['id']}')", 'title' => 'Select'), null, false); ?></td>
            </tr>
        <?php endforeach; ?>
        </tbody>
    </table>
<?php echo $this->element('paging'); ?>
<? endif; ?>
<?php //debug($this->data); ?>